<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@taglib prefix="m" uri="/cutm_tags"%>

<script type="text/javascript">
$(document).ready(function(){
	$('a:has(b)').click(function(){
		if($.browser.msie ){
			window.open($(this).attr('href'));
		}
		$(this).text($(this).text());
	});
});

function checkDelet(id){
	if(BaseJs.confirm('确定要将该邮件放进垃圾箱吗？')){
		$.urlAjax('mail/EditMail!remove?mail.id='+id,function(){
			$('#pt' + id).remove();
		});
	}
}
</script>
<h2 class="title">收件箱</h2>
<table class="list">
	<thead>
		<tr>
			<th width="40%">标题</th>
			<th width="20%">发送日期</th>
			<th width="20%">发送者</th>
			<th width="20%">操作</th>
		</tr>
	</thead>
	<tbody>
		<s:iterator value="mails.items">
			<tr id="pt${id }">
				<td>
				<a
					href="<s:url action="mail/ListMail!show"/>?mail.id=${id}"
					id="n${id }" target="_blank"><s:if test="status==0"><b>
					 <s:property value="title" /></b>
					 </s:if> 
					 <s:else><s:property value="title" /></s:else>
					 </a></td>
				<td><s:date name="createDate" format="yyyy-MM-dd" /></td>
				<td><s:property value="sender.name" /></td>
				<td><m:imgA
					img="delete" msg="删除" onclick="javascript:checkDelet(${id});" /></td>
			</tr>
		</s:iterator>
	</tbody>
</table>
<m:page value="${mails}" />
